/**
 * 洋葱模型
 */

const Koa = require('koa')

const app = new Koa()

app.use(async (ctx, next) => {
  console.log(5555)
  await next()
  console.log(1111)
  ctx.body = 'Hello Zhihu API'
})

app.use(async (ctx, next) => {
  console.log(2222)
  await next()
  console.log(3333)
  ctx.body = 'Hello Zhihu API'
})

app.use(async () => {
  console.log(4444)
})

app.listen(3000)

// 5555 2222 4444 3333 1111
